<template>
	<view class="content" >
			<view class="fixbg" :style="{ background: 'url('+ playList.coverImgUrl+')' }"></view>
		<page-header :title="title" :show="isShow" :color="headColor"></page-header>
		<view class="container">
			<scroll-view scroll-y="true">
				<view class="list-head">
					<view class="list-head-img">
						<image :src="playList.coverImgUrl" ></image>
						<text class="iconfont icon-xiangyousanjiaoxing"> {{ playList.playCount | formatCount }} </text> 
					</view>
					<view class="list-head-text">
						<view>{{playList.name}}</view>
						<view>
							<image :src="playList.creator.avatarUrl" ></image>
							<text>{{ playList.creator.nickname }}</text>
						</view>
						<view>{{ playList.description }}  </view>
					</view>
				</view>
				<!-- #ifdef MP-WEIXIN -->
					<button open-type="share" class="list-share"><text class="iconfont icon-fenxiang"></text>分享给微信好友</button>
				<!-- #endif -->
				
				<!-- #ifdef H5 -->
					<button open-type="share" class="list-share"><text class="iconfont icon-fenxiang"></text>分享给好友</button>
				<!-- #endif -->
				
				<view class="list-music">
					<view class="list-music-head">
						<text class="iconfont icon-bofang1"></text>
						<text>播放全部</text>
						<text>（共{{playList.trackCount}}首）</text>
					</view>
					
					<view class="list-music-item" v-for="(item, index) in playList.tracks" :key="index">
						<view class="list-music-top">
							{{ index +1 }}
						</view>
						<view class="list-music-song">
							<view>{{ item.name}}</view>
							<view>
								<image src="../../static/yun.png"></image>
								<image src="../../static/yun.png"></image>
								{{item.ar[0].name}} - {{ item.al.name}}
							</view>
						</view>
						<text class="iconfont icon-bofang"></text>
					</view>

				</view>
			</scroll-view>
		</view>
	</view>
</template>

<script>
	import pageHeader from '../../components/pageHeader/pageHeader.vue'
	import { list } from '../../common/api.js'
	export default {
		data() {
			return {
				title: "歌单",
				isShow: true,
				playList: {
					creator:""
				},
				headColor: "white"
			}
		},
		onLoad(option) {
			list(option.listId).then(res=>{
				// console.log(res)
				this.playList = res[1].data.playlist
			})
		},
		
		components:{
			pageHeader
		},
		methods: {

		}
	}
</script>

<style scoped>
	.list-head{
		display: flex;
		margin:  30rpx;
	}
	.list-head-img{
		width: 264rpx;
		height: 264rpx;
		border-radius: 20rpx;
		overflow: hidden;
		position: relative;
		margin-right: 42rpx;
	}
	.list-head-img image{
		width: 100%;
		height: 100%;
		filter: brightness(1.1)
	}
	.list-head-img text{
		position: absolute;
		right: 10rpx;
		top: 10rpx;
		color: white;
		font-size: 26rpx;
	}
	
	.list-head-text{
		flex: 1;
		color: #f0f2f7;
	}
	.list-head-text view:nth-child(1){
		font-size: 34rpx;
	}
	
	.list-head-text view:nth-child(2){
		display: flex;
		margin: 20rpx 0;
		line-height: 54rpx;
		font-size: 24rpx;
		align-items: center;
		
	}
	.list-head-text view:nth-child(2) image{
		width: 54rpx;
		height: 54rpx;
		border-radius: 50rpx;
		margin-right: 14rpx;
		
	}
	.list-head-text view:nth-child(3){
		width: 55vw;
		height: 70rpx;
		line-height: 34rpx;
		font-size: 22rpx;
		color: #e5e5e5;
		overflow: hidden;
		white-space: nowrap;
		text-overflow: ellipsis;
	}
	.list-share{
		width: 330rpx;
		height: 74rpx;
		margin: 0 auto;
		border-radius: 37rpx;
		line-height: 74rpx;
		text-align: center;
		font-size: 28rpx;
		background-color: rgba(255,255,255,0.2);
		color: white;
	}
	
	.list-share text{
		margin-right: 16rpx;
	}
	
	.list-music{
		background-color: white;
		width: 100%;
		border-radius: 50rpx;
		margin-top: 40rpx;
		overflow: hidden;
	}
	
	.list-music-head{
		height: 50rpx;
		margin: 30rpx 0 70rpx 22rpx;
	}
	
	.list-music-head text:nth-child(1){
		height: 50rpx;
		font-size: 50rpx;
	}
	
	.list-music-head text:nth-child(2){
		height: 50rpx;
		font-size: 30rpx;
		margin: 0 10rpx 0 26rpx;
	}
	.list-music-head text:nth-child(3){
		height: 50rpx;
		font-size: 26rpx;
		color: #b2b2b2;
	}
	
	.list-music-item{
		display: flex;
		margin: 0 32rpx 66rpx 46rpx;
		align-items: center;
		color: #959595;
	}
	
	.list-music-top{
		width: 58rpx;
		font-size: 30rpx;
		line-height: 50rpx;
	}
	.list-music-song{
		flex: 1;
	}
	
	.list-music-song view:nth-child(1){
		font-size: 28rpx;
		width: 65vw;
		white-space: nowrap;
		text-overflow: ellipsis;
		overflow: hidden;
	}
	
	.list-music-song view:nth-child(2){
		display: flex;
		flex-wrap: nowrap;
		font-size: 20rpx;
		align-items: center;
		width: 65vw;
		white-space: nowrap;
		text-overflow: ellipsis;
		overflow: hidden;

	}
	
	.list-music-song view:nth-child(2) image{
		width: 32rpx;
		height: 20rpx;
		margin-right: 8rpx;
		flex-shrink: 0;
	}
	
	.list-music-item text{
		font-size: 50rpx;
		color: #b7b7b7;
	}
</style>
